﻿@page "/counter2"
<h1>Counter</h1>
<p>Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

@code {
    private int currentCount = 0;

    [Parameter]
    public Action<int> OnMultipleOfTwoAction { get; set; }

    [Parameter]
    public EventCallback<int> OnMultipleOfThree { get; set; }

    private async Task IncrementCount()
    {
        currentCount++;
        if (currentCount % 2 == 0)
            OnMultipleOfTwoAction?.Invoke(currentCount);
        if (currentCount % 3 == 0)
            await OnMultipleOfThree.InvokeAsync(currentCount);
    }
}